package com.cn.ycy.dto;


import com.cn.ycy.config.Add;
import com.cn.ycy.config.Update;
import com.cn.ycy.config.Delete;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

public class Product {

  @NotNull(message = "id 不能为空", groups = {Update.class, Delete.class})
  public Long id;

  @NotBlank(message = "不能为空", groups = {Update.class, Add.class})
  @Length(min=2,max=20,message = "productName长度需要在{2}和{20}之间",groups = {Add.class, Update.class})
  public String productName;

  @Min(value = 0,message = "price 必须大于0")
  public Float price;

  public Boolean isDelete;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getProductName() {
    return productName;
  }

  public void setProductName(String productName) {
    this.productName = productName;
  }

  public Boolean getDelete() {
    return isDelete;
  }

  public void setDelete(Boolean delete) {
    isDelete = delete;
  }

  public Float getPrice() {
    return price;
  }

  public void setPrice(Float price) {
    this.price = price;
  }
}
